package com.handinglian.system.mapper;
import com.handinglian.system.entity.RolePermissionRelation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

@Mapper
public interface RolePermissionRelationMapper {
    int deleteByPrimaryKey(@Param("roleId") Integer roleId, @Param("permissionId") Integer permissionId);

    int insert(RolePermissionRelation record);

    int insertOrUpdate(RolePermissionRelation record);

    int insertOrUpdateSelective(RolePermissionRelation record);

    int insertSelective(RolePermissionRelation record);

    int updateBatch(List<RolePermissionRelation> list);

    int batchInsert(@Param("list") List<RolePermissionRelation> list);

    int deleteByRoleIdAndPermissionIdIn(@Param("roleId")Integer roleId,@Param("permissionIdCollection")Collection<Integer> permissionIdCollection);

    List<Integer> findPermissionIdByRoleId(@Param("roleId")Integer roleId);

    int deleteByRoleId(@Param("roleId")Integer roleId);
}